package model

import (
	"gorm.io/gorm"
	"time"
)

type Address struct {
	Id         uint32         `gorm:"column:id;type:int(10) UNSIGNED;primaryKey;not null;" json:"id"`
	CreateTime time.Time      `gorm:"column:create_time;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"create_time"`
	UpdateTime time.Time      `gorm:"column:update_time;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"update_time"`
	DeleteTime gorm.DeletedAt `gorm:"column:delete_time;type:datetime(3);default:NULL;" json:"delete_time"`
	Phone      string         `gorm:"column:phone;type:varchar(255);comment:手机号;not null;" json:"phone"`       // 手机号
	Area       string         `gorm:"column:area;type:varchar(255);comment:地区;not null;" json:"area"`          // 地区
	Status     int32          `gorm:"column:status;type:int(11);comment:状态 1非默认 2默认;default:1;" json:"status"` // 状态 1非默认 2默认
	UserId     int32          `gorm:"column:user_id;type:int(11);comment:用户id;default:NULL;" json:"user_id"`   // 用户id
}

func (Address) TableName() string {
	return "address"
}
